package com.itheima.edu.info.test;

import java.util.Random;

public class test06 {

    public static void main(String[] args) {
        useRandomNumHandler(()->{
            Random r = new Random();
            int num = r.nextInt(10) + 1;
            return num;
        });
    }

    public static void useRandomNumHandler(RandomNumHandler randomNumHandler){
        int result = randomNumHandler.getNumber();
        System.out.println(result);
    }
}



interface RandomNumHandler {
    int getNumber();
}